
Security News
High Salaries No Longer Enough to Attract Top Cybersecurity Talent
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
@loopback/rest
Advanced tools
Expose controllers as REST endpoints and route REST API requests to controller methods
The REST API package for loopback-next.
This component provides a REST server for your application instances, complete with:
openapi.json
/openapi.yaml
) generation using
@loopback/openapi-v3
To use this package, you'll need to install @loopback/rest
.
npm i @loopback/rest
Here's a basic "Hello World" application using @loopback/rest
:
import {RestApplication, RestServer} from '@loopback/rest';
const app = new RestApplication();
app.handler(({request, response}, sequence) => {
sequence.send(response, 'hello world');
});
(async function start() {
await app.start();
const server = await app.getServer(RestServer);
const port = await server.get('rest.port');
console.log(`Server is running at http://127.0.0.1:${port}`);
})();
See https://loopback.io/doc/en/lb4/Server.html#configuration.
Run npm test
from the root folder.
See all contributors.
MIT
FAQs
Expose controllers as REST endpoints and route REST API requests to controller methods
The npm package @loopback/rest receives a total of 25,055 weekly downloads. As such, @loopback/rest popularity was classified as popular.
We found that @loopback/rest demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.